//
//  EXLoginViewController.m
//  Exercise
//
//  Created by 羊谦 on 16/5/31.
//  Copyright © 2016年 NetEase-yangqian. All rights reserved.
//

#import "EXLoginViewController.h"

@interface EXLoginViewController ()

@property (nonatomic,weak) UIImageView *backgroundImage;//背景图片
@property (nonatomic,weak) UILabel  *loginLabel;//登录字样‘
@property (nonatomic,weak) UITextField *emailTextFiled;//用户名框
@property (nonatomic,weak) UITextField *passwordTextFiled;//密码框

@end

@implementation EXLoginViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
    UIImageView *backgroundImage = [UIImageView new];
    backgroundImage.image = [UIImage imageNamed:@"login_bg"];
    [self.view addSubview:backgroundImage];
    self.backgroundImage = backgroundImage;
    
    UILabel *loginLabel = [UILabel new];
    loginLabel.text = @"登 录";
    loginLabel.textColor = [UIColor whiteColor];
    loginLabel.font = [UIFont systemFontOfSize:35];
    [self.view addSubview:loginLabel];
    self.loginLabel = loginLabel;
    
    UITextField *emailTextFiled = [UITextField new];
    emailTextFiled.textColor = [UIColor whiteColor];
    emailTextFiled.textAlignment = NSTextAlignmentCenter;
    emailTextFiled.text = @"email";
    [self.view addSubview: emailTextFiled];
    self.emailTextFiled = emailTextFiled;
    
    UIView *emailLine = [UIView new];
    emailLine.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:emailLine];
    
    [self.backgroundImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.and.right.and.top.and.bottom.mas_equalTo(self.view);
    }];
    
    [self.loginLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.view.mas_centerX);
        make.top.mas_equalTo(99);
    }];
    
    [self.emailTextFiled mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.view.mas_centerX);
        make.left.mas_equalTo(self.view.mas_left).offset(25);
        make.right.mas_equalTo(self.view.mas_right).offset(-25);
        make.top.mas_equalTo(self.loginLabel).offset(70);
    }];
    
    [emailLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.and.right.mas_equalTo(self.emailTextFiled);
        make.bottom.mas_equalTo(self.emailTextFiled);
    }];
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

@end
